- type = impersonation ? "impersonation" : "personal access"

%h5.prepend-top-0
  Add a #{type} token
%p.profile-settings-content
  Pick a name for the application, and we'll give you a unique #{type} token.

= form_for token, url: path, method: :post, html: { class: 'js-requires-input' } do |f|

  = form_errors(token)

  .row
    .form-group.col-md-6
      = f.label :name, class: 'label-bold'
      = f.text_field :name, class: "form-control", required: true

  .row
    .form-group.col-md-6
      = f.label :expires_at, class: 'label-bold'
      .input-icon-wrapper
        = f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD'
        = icon('calendar', { class: 'input-icon-right' })

  .form-group
    = f.label :scopes, class: 'label-bold'
    = render 'shared/tokens/scopes_form', prefix: 'personal_access_token', token: token, scopes: scopes

  .prepend-top-default
    = f.submit "Create #{type} token", class: "btn btn-create"
